package thread1;

public class Test6 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(){
            @Override
            public void run() {
                System.out.println("工作中！");
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        };
        thread.start();

        Thread.sleep(3000);

        System.out.println("工作结束！");
        System.out.println(thread.getState());
    }
}
